
/* start /scripts/_pages/home.js*/
$(document).ready(function(){'use strict';DGC.ResponsiveImageModal({linkSelector:'.thumb-link',modalSelector:'#thumbModal',imageSelector:'#thumbModalImage',closeSelector:'#thumbModalClose',closeButtonWidth:35,closeButtonHeight:35,closeButtonMargin:20});});

/* end /scripts/_pages/home.js*/

/* start /web-platform/scripts/libs/jquery/plugins/jquery.touchSwipe-1.6.19.min.js*/
/*!
 * @fileOverview TouchSwipe - jQuery Plugin
 * @version 1.6.18
 *
 * @author Matt Bryson http://www.github.com/mattbryson
 * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
 * @see http://labs.rampinteractive.co.uk/touchSwipe/
 * @see http://plugins.jquery.com/project/touchSwipe
 * @license
 * Copyright (c) 2010-2015 Matt Bryson
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 */
!function(factory){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],factory):factory("undefined"!=typeof module&&module.exports?require("jquery"):jQuery)}(function($){"use strict";function init(options){return!options||void 0!==options.allowPageScroll||void 0===options.swipe&&void 0===options.swipeStatus||(options.allowPageScroll=NONE),void 0!==options.click&&void 0===options.tap&&(options.tap=options.click),options||(options={}),options=$.extend({},$.fn.swipe.defaults,options),this.each(function(){var $this=$(this),plugin=$this.data(PLUGIN_NS);plugin||(plugin=new TouchSwipe(this,options),$this.data(PLUGIN_NS,plugin))})}function TouchSwipe(element,options){function touchStart(jqEvent){if(!(getTouchInProgress()||$(jqEvent.target).closest(options.excludedElements,$element).length>0)){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(!event.pointerType||"mouse"!=event.pointerType||0!=options.fallbackToMouseEvents){var ret,touches=event.touches,evt=touches?touches[0]:event;return phase=PHASE_START,touches?fingerCount=touches.length:options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),distance=0,direction=null,currentDirection=null,pinchDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,maximumsMap=createMaximumsData(),cancelMultiFingerRelease(),createFingerData(0,evt),!touches||fingerCount===options.fingers||options.fingers===ALL_FINGERS||hasPinches()?(startTime=getTimeStamp(),2==fingerCount&&(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)),(options.swipeStatus||options.pinchStatus)&&(ret=triggerHandler(event,phase))):ret=!1,ret===!1?(phase=PHASE_CANCEL,triggerHandler(event,phase),ret):(options.hold&&(holdTimeout=setTimeout($.proxy(function(){$element.trigger("hold",[event.target]),options.hold&&(ret=options.hold.call($element,event,event.target))},this),options.longTapThreshold)),setTouchInProgress(!0),null)}}}function touchMove(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(phase!==PHASE_END&&phase!==PHASE_CANCEL&&!inMultiFingerRelease()){var ret,touches=event.touches,evt=touches?touches[0]:event,currentFinger=updateFingerData(evt);if(endTime=getTimeStamp(),touches&&(fingerCount=touches.length),options.hold&&clearTimeout(holdTimeout),phase=PHASE_MOVE,2==fingerCount&&(0==startTouchesDistance?(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)):(updateFingerData(touches[1]),endTouchesDistance=calculateTouchesDistance(fingerData[0].end,fingerData[1].end),pinchDirection=calculatePinchDirection(fingerData[0].end,fingerData[1].end)),pinchZoom=calculatePinchZoom(startTouchesDistance,endTouchesDistance),pinchDistance=Math.abs(startTouchesDistance-endTouchesDistance)),fingerCount===options.fingers||options.fingers===ALL_FINGERS||!touches||hasPinches()){if(direction=calculateDirection(currentFinger.start,currentFinger.end),currentDirection=calculateDirection(currentFinger.last,currentFinger.end),validateDefaultEvent(jqEvent,currentDirection),distance=calculateDistance(currentFinger.start,currentFinger.end),duration=calculateDuration(),setMaxDistance(direction,distance),ret=triggerHandler(event,phase),!options.triggerOnTouchEnd||options.triggerOnTouchLeave){var inBounds=!0;if(options.triggerOnTouchLeave){var bounds=getbounds(this);inBounds=isInBounds(currentFinger.end,bounds)}!options.triggerOnTouchEnd&&inBounds?phase=getNextPhase(PHASE_MOVE):options.triggerOnTouchLeave&&!inBounds&&(phase=getNextPhase(PHASE_END)),phase!=PHASE_CANCEL&&phase!=PHASE_END||triggerHandler(event,phase)}}else phase=PHASE_CANCEL,triggerHandler(event,phase);ret===!1&&(phase=PHASE_CANCEL,triggerHandler(event,phase))}}function touchEnd(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent,touches=event.touches;if(touches){if(touches.length&&!inMultiFingerRelease())return startMultiFingerRelease(event),!0;if(touches.length&&inMultiFingerRelease())return!0}return inMultiFingerRelease()&&(fingerCount=fingerCountAtRelease),endTime=getTimeStamp(),duration=calculateDuration(),didSwipeBackToCancel()||!validateSwipeDistance()?(phase=PHASE_CANCEL,triggerHandler(event,phase)):options.triggerOnTouchEnd||options.triggerOnTouchEnd===!1&&phase===PHASE_MOVE?(options.preventDefaultEvents!==!1&&jqEvent.cancelable!==!1&&jqEvent.preventDefault(),phase=PHASE_END,triggerHandler(event,phase)):!options.triggerOnTouchEnd&&hasTap()?(phase=PHASE_END,triggerHandlerForGesture(event,phase,TAP)):phase===PHASE_MOVE&&(phase=PHASE_CANCEL,triggerHandler(event,phase)),setTouchInProgress(!1),null}function touchCancel(){fingerCount=0,endTime=0,startTime=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,cancelMultiFingerRelease(),setTouchInProgress(!1)}function touchLeave(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;options.triggerOnTouchLeave&&(phase=getNextPhase(PHASE_END),triggerHandler(event,phase))}function removeListeners(){$element.off(START_EV,touchStart),$element.off(CANCEL_EV,touchCancel),$element.off(MOVE_EV,touchMove),$element.off(END_EV,touchEnd),LEAVE_EV&&$element.off(LEAVE_EV,touchLeave),setTouchInProgress(!1)}function getNextPhase(currentPhase){var nextPhase=currentPhase,validTime=validateSwipeTime(),validDistance=validateSwipeDistance(),didCancel=didSwipeBackToCancel();return!validTime||didCancel?nextPhase=PHASE_CANCEL:!validDistance||currentPhase!=PHASE_MOVE||options.triggerOnTouchEnd&&!options.triggerOnTouchLeave?!validDistance&&currentPhase==PHASE_END&&options.triggerOnTouchLeave&&(nextPhase=PHASE_CANCEL):nextPhase=PHASE_END,nextPhase}function triggerHandler(event,phase){var ret,touches=event.touches;return(didSwipe()||hasSwipes())&&(ret=triggerHandlerForGesture(event,phase,SWIPE)),(didPinch()||hasPinches())&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,PINCH)),didDoubleTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,DOUBLE_TAP):didLongTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,LONG_TAP):didTap()&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,TAP)),phase===PHASE_CANCEL&&touchCancel(event),phase===PHASE_END&&(touches?touches.length||touchCancel(event):touchCancel(event)),ret}function triggerHandlerForGesture(event,phase,gesture){var ret;if(gesture==SWIPE){if($element.trigger("swipeStatus",[phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection]),options.swipeStatus&&(ret=options.swipeStatus.call($element,event,phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection),ret===!1))return!1;if(phase==PHASE_END&&validateSwipe()){if(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),$element.trigger("swipe",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipe&&(ret=options.swipe.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection),ret===!1))return!1;switch(direction){case LEFT:$element.trigger("swipeLeft",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeLeft&&(ret=options.swipeLeft.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case RIGHT:$element.trigger("swipeRight",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeRight&&(ret=options.swipeRight.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case UP:$element.trigger("swipeUp",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeUp&&(ret=options.swipeUp.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case DOWN:$element.trigger("swipeDown",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeDown&&(ret=options.swipeDown.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection))}}}if(gesture==PINCH){if($element.trigger("pinchStatus",[phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchStatus&&(ret=options.pinchStatus.call($element,event,phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData),ret===!1))return!1;if(phase==PHASE_END&&validatePinch())switch(pinchDirection){case IN:$element.trigger("pinchIn",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchIn&&(ret=options.pinchIn.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData));break;case OUT:$element.trigger("pinchOut",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchOut&&(ret=options.pinchOut.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData))}}return gesture==TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),hasDoubleTap()&&!inDoubleTap()?(doubleTapStartTime=getTimeStamp(),singleTapTimeout=setTimeout($.proxy(function(){doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target))},this),options.doubleTapThreshold)):(doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target)))):gesture==DOUBLE_TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),doubleTapStartTime=null,$element.trigger("doubletap",[event.target]),options.doubleTap&&(ret=options.doubleTap.call($element,event,event.target))):gesture==LONG_TAP&&(phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),doubleTapStartTime=null,$element.trigger("longtap",[event.target]),options.longTap&&(ret=options.longTap.call($element,event,event.target)))),ret}function validateSwipeDistance(){var valid=!0;return null!==options.threshold&&(valid=distance>=options.threshold),valid}function didSwipeBackToCancel(){var cancelled=!1;return null!==options.cancelThreshold&&null!==direction&&(cancelled=getMaxDistance(direction)-distance>=options.cancelThreshold),cancelled}function validatePinchDistance(){return null!==options.pinchThreshold?pinchDistance>=options.pinchThreshold:!0}function validateSwipeTime(){var result;return result=options.maxTimeThreshold?!(duration>=options.maxTimeThreshold):!0}function validateDefaultEvent(jqEvent,direction){if(options.preventDefaultEvents!==!1)if(options.allowPageScroll===NONE)jqEvent.preventDefault();else{var auto=options.allowPageScroll===AUTO;switch(direction){case LEFT:(options.swipeLeft&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case RIGHT:(options.swipeRight&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case UP:(options.swipeUp&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case DOWN:(options.swipeDown&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case NONE:}}}function validatePinch(){var hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),hasCorrectDistance=validatePinchDistance();return hasCorrectFingerCount&&hasEndPoint&&hasCorrectDistance}function hasPinches(){return!!(options.pinchStatus||options.pinchIn||options.pinchOut)}function didPinch(){return!(!validatePinch()||!hasPinches())}function validateSwipe(){var hasValidTime=validateSwipeTime(),hasValidDistance=validateSwipeDistance(),hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),didCancel=didSwipeBackToCancel(),valid=!didCancel&&hasEndPoint&&hasCorrectFingerCount&&hasValidDistance&&hasValidTime;return valid}function hasSwipes(){return!!(options.swipe||options.swipeStatus||options.swipeLeft||options.swipeRight||options.swipeUp||options.swipeDown)}function didSwipe(){return!(!validateSwipe()||!hasSwipes())}function validateFingers(){return fingerCount===options.fingers||options.fingers===ALL_FINGERS||!SUPPORTS_TOUCH}function validateEndPoint(){return 0!==fingerData[0].end.x}function hasTap(){return!!options.tap}function hasDoubleTap(){return!!options.doubleTap}function hasLongTap(){return!!options.longTap}function validateDoubleTap(){if(null==doubleTapStartTime)return!1;var now=getTimeStamp();return hasDoubleTap()&&now-doubleTapStartTime<=options.doubleTapThreshold}function inDoubleTap(){return validateDoubleTap()}function validateTap(){return(1===fingerCount||!SUPPORTS_TOUCH)&&(isNaN(distance)||distance<options.threshold)}function validateLongTap(){return duration>options.longTapThreshold&&DOUBLE_TAP_THRESHOLD>distance}function didTap(){return!(!validateTap()||!hasTap())}function didDoubleTap(){return!(!validateDoubleTap()||!hasDoubleTap())}function didLongTap(){return!(!validateLongTap()||!hasLongTap())}function startMultiFingerRelease(event){previousTouchEndTime=getTimeStamp(),fingerCountAtRelease=event.touches.length+1}function cancelMultiFingerRelease(){previousTouchEndTime=0,fingerCountAtRelease=0}function inMultiFingerRelease(){var withinThreshold=!1;if(previousTouchEndTime){var diff=getTimeStamp()-previousTouchEndTime;diff<=options.fingerReleaseThreshold&&(withinThreshold=!0)}return withinThreshold}function getTouchInProgress(){return!($element.data(PLUGIN_NS+"_intouch")!==!0)}function setTouchInProgress(val){$element&&(val===!0?($element.on(MOVE_EV,touchMove),$element.on(END_EV,touchEnd),LEAVE_EV&&$element.on(LEAVE_EV,touchLeave)):($element.off(MOVE_EV,touchMove,!1),$element.off(END_EV,touchEnd,!1),LEAVE_EV&&$element.off(LEAVE_EV,touchLeave,!1)),$element.data(PLUGIN_NS+"_intouch",val===!0))}function createFingerData(id,evt){var f={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return f.start.x=f.last.x=f.end.x=evt.pageX||evt.clientX,f.start.y=f.last.y=f.end.y=evt.pageY||evt.clientY,fingerData[id]=f,f}function updateFingerData(evt){var id=void 0!==evt.identifier?evt.identifier:0,f=getFingerData(id);return null===f&&(f=createFingerData(id,evt)),f.last.x=f.end.x,f.last.y=f.end.y,f.end.x=evt.pageX||evt.clientX,f.end.y=evt.pageY||evt.clientY,f}function getFingerData(id){return fingerData[id]||null}function setMaxDistance(direction,distance){direction!=NONE&&(distance=Math.max(distance,getMaxDistance(direction)),maximumsMap[direction].distance=distance)}function getMaxDistance(direction){return maximumsMap[direction]?maximumsMap[direction].distance:void 0}function createMaximumsData(){var maxData={};return maxData[LEFT]=createMaximumVO(LEFT),maxData[RIGHT]=createMaximumVO(RIGHT),maxData[UP]=createMaximumVO(UP),maxData[DOWN]=createMaximumVO(DOWN),maxData}function createMaximumVO(dir){return{direction:dir,distance:0}}function calculateDuration(){return endTime-startTime}function calculateTouchesDistance(startPoint,endPoint){var diffX=Math.abs(startPoint.x-endPoint.x),diffY=Math.abs(startPoint.y-endPoint.y);return Math.round(Math.sqrt(diffX*diffX+diffY*diffY))}function calculatePinchZoom(startDistance,endDistance){var percent=endDistance/startDistance*1;return percent.toFixed(2)}function calculatePinchDirection(){return 1>pinchZoom?OUT:IN}function calculateDistance(startPoint,endPoint){return Math.round(Math.sqrt(Math.pow(endPoint.x-startPoint.x,2)+Math.pow(endPoint.y-startPoint.y,2)))}function calculateAngle(startPoint,endPoint){var x=startPoint.x-endPoint.x,y=endPoint.y-startPoint.y,r=Math.atan2(y,x),angle=Math.round(180*r/Math.PI);return 0>angle&&(angle=360-Math.abs(angle)),angle}function calculateDirection(startPoint,endPoint){if(comparePoints(startPoint,endPoint))return NONE;var angle=calculateAngle(startPoint,endPoint);return 45>=angle&&angle>=0?LEFT:360>=angle&&angle>=315?LEFT:angle>=135&&225>=angle?RIGHT:angle>45&&135>angle?DOWN:UP}function getTimeStamp(){var now=new Date;return now.getTime()}function getbounds(el){el=$(el);var offset=el.offset(),bounds={left:offset.left,right:offset.left+el.outerWidth(),top:offset.top,bottom:offset.top+el.outerHeight()};return bounds}function isInBounds(point,bounds){return point.x>bounds.left&&point.x<bounds.right&&point.y>bounds.top&&point.y<bounds.bottom}function comparePoints(pointA,pointB){return pointA.x==pointB.x&&pointA.y==pointB.y}var options=$.extend({},options),useTouchEvents=SUPPORTS_TOUCH||SUPPORTS_POINTER||!options.fallbackToMouseEvents,START_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerDown":"pointerdown":"touchstart":"mousedown",MOVE_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerMove":"pointermove":"touchmove":"mousemove",END_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerUp":"pointerup":"touchend":"mouseup",LEAVE_EV=useTouchEvents?SUPPORTS_POINTER?"mouseleave":null:"mouseleave",CANCEL_EV=SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?"MSPointerCancel":"pointercancel":"touchcancel",distance=0,direction=null,currentDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,pinchDirection=0,maximumsMap=null,$element=$(element),phase="start",fingerCount=0,fingerData={},startTime=0,endTime=0,previousTouchEndTime=0,fingerCountAtRelease=0,doubleTapStartTime=0,singleTapTimeout=null,holdTimeout=null;try{$element.on(START_EV,touchStart),$element.on(CANCEL_EV,touchCancel)}catch(e){$.error("events not supported "+START_EV+","+CANCEL_EV+" on jQuery.swipe")}this.enable=function(){return this.disable(),$element.on(START_EV,touchStart),$element.on(CANCEL_EV,touchCancel),$element},this.disable=function(){return removeListeners(),$element},this.destroy=function(){removeListeners(),$element.data(PLUGIN_NS,null),$element=null},this.option=function(property,value){if("object"==typeof property)options=$.extend(options,property);else if(void 0!==options[property]){if(void 0===value)return options[property];options[property]=value}else{if(!property)return options;$.error("Option "+property+" does not exist on jQuery.swipe.options")}return null}}var VERSION="1.6.18",LEFT="left",RIGHT="right",UP="up",DOWN="down",IN="in",OUT="out",NONE="none",AUTO="auto",SWIPE="swipe",PINCH="pinch",TAP="tap",DOUBLE_TAP="doubletap",LONG_TAP="longtap",HORIZONTAL="horizontal",VERTICAL="vertical",ALL_FINGERS="all",DOUBLE_TAP_THRESHOLD=10,PHASE_START="start",PHASE_MOVE="move",PHASE_END="end",PHASE_CANCEL="cancel",SUPPORTS_TOUCH="ontouchstart"in window,SUPPORTS_POINTER_IE10=window.navigator.msPointerEnabled&&!window.PointerEvent&&!SUPPORTS_TOUCH,SUPPORTS_POINTER=(window.PointerEvent||window.navigator.msPointerEnabled)&&!SUPPORTS_TOUCH,PLUGIN_NS="TouchSwipe",defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:".noSwipe",preventDefaultEvents:!0};$.fn.swipe=function(method){var $this=$(this),plugin=$this.data(PLUGIN_NS);if(plugin&&"string"==typeof method){if(plugin[method])return plugin[method].apply(plugin,Array.prototype.slice.call(arguments,1));$.error("Method "+method+" does not exist on jQuery.swipe")}else if(plugin&&"object"==typeof method)plugin.option.apply(plugin,arguments);else if(!(plugin||"object"!=typeof method&&method))return init.apply(this,arguments);return $this},$.fn.swipe.version=VERSION,$.fn.swipe.defaults=defaults,$.fn.swipe.phases={PHASE_START:PHASE_START,PHASE_MOVE:PHASE_MOVE,PHASE_END:PHASE_END,PHASE_CANCEL:PHASE_CANCEL},$.fn.swipe.directions={LEFT:LEFT,RIGHT:RIGHT,UP:UP,DOWN:DOWN,IN:IN,OUT:OUT},$.fn.swipe.pageScroll={NONE:NONE,HORIZONTAL:HORIZONTAL,VERTICAL:VERTICAL,AUTO:AUTO},$.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:ALL_FINGERS}});

/* end /web-platform/scripts/libs/jquery/plugins/jquery.touchSwipe-1.6.19.min.js*/

/* start /web-platform/scripts/libs/utils/easing.js*/
var easing=function(n){function t(r){if(e[r])return e[r].exports;var u=e[r]={exports:{},id:r,loaded:!1};return n[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var e={};return t.m=n,t.c=e,t.p="",t(0)}([function(n,t){"use strict";function e(n){return n}function r(n){return-1*Math.cos(n*(Math.PI/2))+1}function u(n){return Math.sin(n*(Math.PI/2))}function a(n){return-.5*(Math.cos(Math.PI*n)-1)}function i(n){return n*n}function o(n){return n*(2-n)}function s(n){return.5>n?2*n*n:-1+(4-2*n)*n}function c(n){return n*n*n}function f(n){var t=n-1;return t*t*t+1}function h(n){return.5>n?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1}function M(n){return n*n*n*n}function v(n){var t=n-1;return 1-t*t*t*t}function I(n){var t=n-1;return.5>n?8*n*n*n*n:1-8*t*t*t*t}function O(n){return n*n*n*n*n}function p(n){var t=n-1;return 1+t*t*t*t*t}function d(n){var t=n-1;return.5>n?16*n*n*n*n*n:1+16*t*t*t*t*t}function l(n){return 0===n?0:Math.pow(2,10*(n-1))}function P(n){return 1===n?1:-Math.pow(2,-10*n)+1}function Q(n){if(0===n||1===n)return n;var t=2*n,e=t-1;return 1>t?.5*Math.pow(2,10*e):.5*(-Math.pow(2,-10*e)+2)}function w(n){var t=n/1;return-1*(Math.sqrt(1-t*n)-1)}function x(n){var t=n-1;return Math.sqrt(1-t*t)}function g(n){var t=2*n,e=t-2;return 1>t?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-e*e)+1)}function B(n){var t=arguments.length<=1||void 0===arguments[1]?1.70158:arguments[1],e=n/1;return e*e*((t+1)*e-t)}function C(n){var t=arguments.length<=1||void 0===arguments[1]?1.70158:arguments[1],e=n/1-1;return e*e*((t+1)*e+t)+1}function E(n){var t=arguments.length<=1||void 0===arguments[1]?1.70158:arguments[1],e=2*n,r=e-2,u=1.525*t;return 1>e?.5*e*e*((u+1)*e-u):.5*(r*r*((u+1)*r+u)+2)}function b(n){var t=arguments.length<=1||void 0===arguments[1]?.7:arguments[1];if(0===n||1===n)return n;var e=n/1,r=e-1,u=1-t,a=u/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*r)*Math.sin((r-a)*(2*Math.PI)/u))}function q(n){var t=arguments.length<=1||void 0===arguments[1]?.7:arguments[1],e=1-t,r=2*n;if(0===n||1===n)return n;var u=e/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*r)*Math.sin((r-u)*(2*Math.PI)/e)+1}function k(n){var t=arguments.length<=1||void 0===arguments[1]?.65:arguments[1],e=1-t;if(0===n||1===n)return n;var r=2*n,u=r-1,a=e/(2*Math.PI)*Math.asin(1);return 1>r?-.5*(Math.pow(2,10*u)*Math.sin((u-a)*(2*Math.PI)/e)):Math.pow(2,-10*u)*Math.sin((u-a)*(2*Math.PI)/e)*.5+1}function S(n){var t=n/1;if(1/2.75>t)return 7.5625*t*t;if(2/2.75>t){var e=t-1.5/2.75;return 7.5625*e*e+.75}if(2.5/2.75>t){var r=t-2.25/2.75;return 7.5625*r*r+.9375}var u=t-2.625/2.75;return 7.5625*u*u+.984375}function _(n){return 1-S(1-n)}function j(n){return.5>n?.5*_(2*n):.5*S(2*n-1)+.5}Object.defineProperty(t,"__esModule",{value:!0}),t.linear=e,t.easeInSine=r,t.easeOutSine=u,t.easeInOutSine=a,t.easeInQuad=i,t.easeOutQuad=o,t.easeInOutQuad=s,t.easeInCubic=c,t.easeOutCubic=f,t.easeInOutCubic=h,t.easeInQuart=M,t.easeOutQuart=v,t.easeInOutQuart=I,t.easeInQuint=O,t.easeOutQuint=p,t.easeInOutQuint=d,t.easeInExpo=l,t.easeOutExpo=P,t.easeInOutExpo=Q,t.easeInCirc=w,t.easeOutCirc=x,t.easeInOutCirc=g,t.easeInBack=B,t.easeOutBack=C,t.easeInOutBack=E,t.easeInElastic=b,t.easeOutElastic=q,t.easeInOutElastic=k,t.easeOutBounce=S,t.easeInBounce=_,t.easeInOutBounce=j}]);

/* end /web-platform/scripts/libs/utils/easing.js*/

/* start /web-platform/scripts/web-platform/component/media-modal.js*/
window.SOE=window.SOE||{};window.SOE.MediaModal=(function(){'use strict';var YOUTUBE_FAILURE_RETRY_COUNT=3;var _numDots=5;var _dotBarAutosizeSettings=null;var _numVideoThumbs=6;var _didInit=false;var _youTubeInitStarted=false;var _youTubeInitFinished=false;var _downloadListFunc=null;var _filterFunc=null;var _originalUrl=null;var _imageInfo=null;var _youTubeVideos=null;let youTubePlayer;function _updateDotPos(idx){var $allDots=$('#dotOverflowContainer .dot');var $visibleDots=$allDots.filter(':not(.filtered)');var pageIdx=Math.floor($visibleDots.index($allDots.eq(idx))/_numDots);$allDots.removeClass('active').eq(idx).addClass('active');$('#dotOverflowContainer').stop().animate({left:pageIdx* -$('#paginationDotContainer').width()},function(){$('.modalControl').removeClass('disabled');});_updateDownloadList(idx);_updatePermalink(idx);}
function _updateDownloadList(dotIdx){if(_downloadListFunc){_downloadListFunc(_imageInfo[dotIdx].userId,$('#mediaModalDownload ul').empty());}}
function _updatePermalink(dotIdx){if(_originalUrl&&window.history.replaceState){window.history.replaceState(null,document.title,_imageInfo[dotIdx].permalinkUrl);}}
function _autosizeDotBar(){if(_dotBarAutosizeSettings){var windowWidth=window.innerWidth||document.documentElement.clientWidth;var totalDots=parseInt($('#mediaModalHeader .mediaTotal').text(),10);var widestPossibleContainer=Math.floor((windowWidth*_dotBarAutosizeSettings.maxWidth)/_dotBarAutosizeSettings.dotWidth)*_dotBarAutosizeSettings.dotWidth;var allDotsWidth=totalDots*_dotBarAutosizeSettings.dotWidth;var finalDotBarWidth=Math.min(widestPossibleContainer,allDotsWidth);var visibleDots=(finalDotBarWidth/_dotBarAutosizeSettings.dotWidth);var allDotsVisible=(visibleDots>=totalDots);$('#media-modal .pagNavBtn').toggleClass('hidden',allDotsVisible);$('#paginationDotContainer').width(finalDotBarWidth);setDotCount(visibleDots);}}
function _init(){if(_didInit){return;}
_didInit=true;$('#media-modal').on('soe.updateDot',function(evt,dot){var $allDots=$('#dotOverflowContainer .dot');var $visibleDots=$allDots.filter(':not(.filtered)');$('#media-modal-image').attr('src',_imageInfo[dot].imageUrl);$('#mediaModalHeader .mediaNum').text($visibleDots.index($allDots.eq(dot))+1);_updateDotPos(dot);});$('#media-modal').on('soe.arrowClick',function(evt,dir){var $allDots=$('#dotOverflowContainer .dot');var $visibleDots=$allDots.filter(':not(.filtered)');var selectedVisibleDot=$visibleDots.index($allDots.filter('.active'))+1;var selectedDot;if(dir==='next'){if(selectedVisibleDot<$visibleDots.length){selectedVisibleDot++;}else{selectedVisibleDot=1;}}else if(selectedVisibleDot>1){selectedVisibleDot--;}else{selectedVisibleDot=$visibleDots.length;}
selectedDot=$allDots.index($visibleDots.eq(selectedVisibleDot-1));$('#media-modal-image').attr('src',_imageInfo[selectedDot].imageUrl);$('#mediaModalHeader .mediaNum').text(selectedVisibleDot);_updateDotPos(selectedDot);});$('#media-modal').on('click','.pagDot',function(){var idx=$('#dotOverflowContainer .pagDot').index(this);$('#media-modal').trigger('soe.updateDot',idx);});$('#media-modal').on('keydown',function(key){if(key.which===37){$('#media-modal').trigger('soe.arrowClick','prev');}else if(key.which===39){$('#media-modal').trigger('soe.arrowClick','next');}});$('.modalTraverse').on('click',function(){$('#media-modal').trigger('soe.arrowClick',this.getAttribute('rel'));});$('#media-modal').on('mouseenter','.pagDot',function(){var $this=$(this);var idx=$('#dotOverflowContainer .pagDot').index($this);var dotWidth=parseInt($this.outerWidth(true),10)/2;var dotLeft=$this.offset().left;var tooltip=$('#paginationImages');if(!tooltip.hasClass('hidden')){var tooltipWidth=parseInt(tooltip.outerWidth(),10)/2;tooltip.stop().animate({left:(dotLeft+dotWidth)-tooltipWidth},'fast');$('#paginationImgSlider').stop().animate({left:idx* -parseInt(tooltip.width(),10)},'fast');tooltip.show();}});$('#media-modal').on('mouseleave','.pagDot',function(){$('#paginationImages').hide();});$('.pagNavBtn').on('click',function(){var dotContainer=$('#dotOverflowContainer');var pageContainer=$('#paginationDotContainer');var pageWidth=pageContainer.width();var pages=Math.ceil(dotContainer.find('.dot:not(.filtered)').length/_numDots);var nextShift;var maxContainerShift=((pages-1)* -pageWidth);if(this.getAttribute('rel')==='next'){nextShift=parseInt(dotContainer.css('left'),10)-pageWidth;if(nextShift<maxContainerShift){dotContainer.stop().animate({left:0});}else{dotContainer.stop().animate({left:nextShift});}}else{nextShift=parseInt(dotContainer.css('left'),10)+pageWidth;if(nextShift>0){dotContainer.stop().animate({left:maxContainerShift});}else{dotContainer.stop().animate({left:nextShift});}}});$('#mediaModalFilter').on('click','.dropdown-menu a',function(e){e.preventDefault();if(_filterFunc){var $allDots,$visibleDots;var filterId=this.getAttribute('data-filter-id');$('#dotOverflowContainer .dot').each(function(dotIdx){$(this).toggleClass('filtered',!_filterFunc(_imageInfo[dotIdx].userId,filterId));});$allDots=$('#dotOverflowContainer .dot');$visibleDots=$allDots.filter(':not(.filtered)');$('#mediaModalHeader .mediaTotal').text($visibleDots.length);_autosizeDotBar();$('#media-modal').trigger('soe.updateDot',$allDots.index($visibleDots.eq(0)));}});$(document).on('hide.bs.modal','#media-modal.image-content',function(){if(_originalUrl&&window.history.replaceState){window.history.replaceState(null,document.title,_originalUrl);}
$(window).off('.mediaModal');_downloadListFunc=null;_filterFunc=null;_originalUrl=null;_imageInfo=null;});}
function _initYouTube(readyFn){if(_youTubeInitFinished){if(readyFn){readyFn();}
return;}
if(readyFn){$(document).on('onYouTubeIframeAPIReady',function(){readyFn();});}
if(_youTubeInitStarted){return;}
_youTubeInitStarted=true;$(document).on('show.bs.modal','#media-modal.video-content',function(){if($('#media-modal .modal-video-playlist ul li').length<=0){youTubePlayer=new YT.Player($('#media-modal .modal-video-replace').get(0),{width:'100%',height:'100%',host:'https://www.youtube-nocookie.com',playerVars:{autoplay:1,theme:'dark',color:'black',rel:0,wmode:'opaque'},videoId:$(this).data('youtube-video-id'),events:{onReady:videoReady,onStateChange:videoStateChange,onError:videoError}});}else{startPlaylist();}});function videoReady(e){$(document).trigger('onYouTubeReady',e);}
function videoStateChange(e){$(document).trigger('onYouTubeStateChange',e);}
function videoError(e){$(document).trigger('onYouTubeError',e);}
function startPlaylist(){youTubePlayer=new YT.Player($('#media-modal .modal-video-replace').get(0),{host:'https://www.youtube-nocookie.com',playerVars:{autoplay:1,theme:'dark',color:'black',rel:0,wmode:'opaque'},events:{onReady:playlistReady,onStateChange:playlistStateChange,onError:playlistError}});}
function playlistReady(e){var playlist=_.pluck(_youTubeVideos,'id');var startVideo=$('#media-modal.video-content').data('youtube-video-id');$('#media-modal .modal-video-playlist').data('youtube-fail-count',0);youTubePlayer.loadPlaylist(playlist.join(','),playlist.indexOf(startVideo));$(document).trigger('onYouTubeReady',e);}
function playlistStateChange(e){var currentVideoIndex;if(e.data===YT.PlayerState.PLAYING){currentVideoIndex=youTubePlayer.getPlaylistIndex();$('#media-modal .modal-video-playlist a').removeClass('now-playing').eq(currentVideoIndex).addClass('now-playing');$('#media-modal .modal-video-details .title').text(_youTubeVideos[currentVideoIndex].title);$('#media-modal .modal-video-details .username').attr('href','https://www.youtube.com/channel/'+_youTubeVideos[currentVideoIndex].channelId).text(_youTubeVideos[currentVideoIndex].username);$('#media-modal .modal-video-details .date').text(_youTubeVideos[currentVideoIndex].timestamp.toDateString());showPlaylistPage(Math.floor(currentVideoIndex/_numVideoThumbs));}
$(document).trigger('onYouTubeStateChange',e);}
function playlistError(e){var failureCount;if(e.data===5){failureCount=$('#media-modal .modal-video-playlist').data('youtube-fail-count');if(failureCount<YOUTUBE_FAILURE_RETRY_COUNT){youTubePlayer.stopVideo();$('#media-modal .modal-video-replace').after('<div class="modal-video-replace"></div>').remove();$('#media-modal .modal-video-playlist').data('youtube-fail-count',failureCount+1);$('#media-modal').data('youtube-video-id',_youTubeVideos[youTubePlayer.getPlaylistIndex()].id);startPlaylist();}}
$(document).trigger('onYouTubeError',e);}
function showPlaylistPage(page){$('#media-modal .modal-video-playlist ul').data('page',page).css('margin-left',(page* -100)+'%');}
function getPlaylistPage(){return $('#media-modal .modal-video-playlist ul').data('page');}
$(document).on('hide.bs.modal','#media-modal.video-content',function(){try{youTubePlayer.stopVideo();youTubePlayer.destroy();youTubePlayer=null;}catch(e){}
$('#media-modal .modal-video').empty();_youTubeVideos=null;});$(document).on('click','#media-modal.video-content .modal-video-playlist a',function(){var selectedIndex=$('#media-modal .modal-video-playlist a').index(this);youTubePlayer.playVideoAt(selectedIndex);});$(document).on('click','#media-modal.video-content .playlist-pag-prev, #media-modal.video-content .playlist-pag-next',function(){var newPage,currentPage=getPlaylistPage(),firstPage=0,lastPage=(Math.ceil(_youTubeVideos.length/_numVideoThumbs)-1);if($(this).hasClass('playlist-pag-prev')){newPage=currentPage<=firstPage?lastPage:(currentPage-1);}else{newPage=currentPage>=lastPage?firstPage:(currentPage+1);}
showPlaylistPage(newPage);});window.onYouTubeIframeAPIReady=function(e){_youTubeInitFinished=true;$(document).trigger('onYouTubeIframeAPIReady',e);};}
function setDotCount(numDots){if(numDots>0){_numDots=numDots;}}
function setAutosizeDotBar(options){if(options){var defaults={maxWidth:0.7,dotWidth:1};_dotBarAutosizeSettings=$.extend({},defaults,options);}else{_dotBarAutosizeSettings=null;}}
function setupGroup(options){var defaults={container:null,selector:'a',hidePaginationThumbs:false,permalinkAttribute:null,userIdAttribute:null};var _options=$.extend({},defaults,options);_init();$(_options.container).on('click',_options.selector,function(e){var i,imageInfo=[];var localOptions=$.extend({},_options);var $allItems=$(localOptions.container).find(localOptions.selector);for(i=0;i<$allItems.length;++i){imageInfo.push({imageUrl:$allItems[i].getAttribute('href'),thumbUrl:localOptions.hidePaginationThumbs?null:$allItems.eq(i).find('img').attr('src'),userId:localOptions.userIdAttribute?$allItems[i].getAttribute(localOptions.userIdAttribute):null,permalinkUrl:localOptions.permalinkAttribute?$allItems[i].getAttribute(localOptions.permalinkAttribute):null});}
localOptions.hasPermalinks=Boolean(localOptions.permalinkAttribute);localOptions.hasThumbs=!localOptions.hidePaginationThumbs;localOptions.imageInfo=imageInfo;localOptions.initialItem=$allItems.index(this);showGroup(localOptions);e.preventDefault();});}
function showGroup(options){var defaults={typeName:null,containY:false,centerY:false,hasThumbs:false,hasPermalinks:false,downloadListFunc:null,filterList:null,filterFunc:null,initialItem:0,imageInfo:[]};var i,dotContainerWidth,dotMarkup='',paginationMarkup='';var _options=$.extend({},defaults,options);var dotTemplate=$('#tpl-pagination-dot').html();var filterTemplate=_.template($('#tpl-media-filter-list-item').html());var hasDownloads=(typeof _options.downloadListFunc==='function');var hasFilters=Boolean((_options.filterList&&options.filterList.length>0&&typeof _options.filterFunc==='function'));_init();_imageInfo=_options.imageInfo;$('#mediaModalHeader .mediaType').text(_options.typeName);$('#mediaModalHeader .mediaNum').text(_options.initialItem+1);$('#mediaModalHeader .mediaTotal').text(_options.imageInfo.length);$('#media-modal-image').attr('src',_options.imageInfo[_options.initialItem].imageUrl);$('#mediaModalDownload').toggleClass('hidden',!hasDownloads);$('#mediaModalFilter').toggleClass('hidden',!hasFilters);$('#dotOverflowContainer').empty().width(9999999);$('#paginationImgSlider').empty();$('#paginationImages').toggleClass('hidden',!_options.hasThumbs);for(i=0;i<_options.imageInfo.length;++i){dotMarkup+=dotTemplate;if(_options.hasThumbs){paginationMarkup+='<img src="'+_options.imageInfo[i].thumbUrl+'"/>';}}
$('#dotOverflowContainer').append($(dotMarkup));$('#paginationImgSlider').width(9999999).append($(paginationMarkup));$('#dotOverflowContainer .dot').eq(_options.initialItem).addClass('active');if(_options.hasPermalinks){_originalUrl=window.location.href;_updatePermalink(_options.initialItem);}
if(hasDownloads){_downloadListFunc=_options.downloadListFunc;_updateDownloadList(_options.initialItem);}
if(hasFilters){_filterFunc=_options.filterFunc;$('#mediaModalFilter ul').empty();for(i=0;i<_options.filterList.length;++i){$('#mediaModalFilter ul').append($(filterTemplate({filterId:_options.filterList[i].id,filterTitle:_options.filterList[i].title})));}}
if(_dotBarAutosizeSettings){$(window).on('resize.mediaModal',_autosizeDotBar);_autosizeDotBar();}
dotContainerWidth=$('#paginationDotContainer').width();$('#dotOverflowContainer').css('left',(Math.ceil((_options.initialItem+1)/_numDots)-1)* -dotContainerWidth);$('#media-modal').removeClass().addClass('modal fade image-content');$('#media-modal').toggleClass('contain-y',_options.containY);$('#media-modal').toggleClass('center-y',_options.centerY);$('#media-modal').modal();}
function setupPoster(options){var defaults={container:null,selector:'a'};var _options=$.extend({},defaults,options);_init();$(_options.container).on('click',_options.selector,function(event){showPoster($.extend({},_options,{url:this.getAttribute('href')}));event.preventDefault();});}
function showPoster(options){var defaults={scroll:true,containY:false};var _options=$.extend({},defaults,options);_init();$('#media-modal-image').attr('src',_options.url);$('#media-modal').removeClass().addClass('modal fade image-content');$('#media-modal').toggleClass('full-scroll',_options.scroll);$('#media-modal').toggleClass('full-fixed',!_options.scroll);$('#media-modal').toggleClass('contain-y',_options.containY);$('#media-modal').modal();}
function setTrayThumbCount(thumbsPerPage){if(thumbsPerPage>0){_numVideoThumbs=thumbsPerPage;}}
function findYouTubeId(url){var idSniff=/(?:youtube\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i;var matches=url.match(idSniff);if(matches&&matches.length>=2){return matches[1];}else{return null;}}
function setupYouTube(options){if(!globs.wdl.wdlCookDNT){_initYouTube(function(){var defaults={linkSelector:null,defaultVideoID:null};var _options=$.extend({},defaults,options);$(document).on('click',_options.linkSelector,function(event){var videoID;if($(window).width()>=768){event.preventDefault();videoID=findYouTubeId(this.getAttribute('href'))||_options.defaultVideoID;showYouTube({videoId:videoID});}});});}}
function showYouTube(options){if(!globs.wdl.wdlCookDNT){_initYouTube(function(){var defaults={videoId:null,videos:null};var i,playlistTemplate,playlistContents;var _options=$.extend({},defaults,options);var $modal=$('#media-modal');if(youTubePlayer){youTubePlayer.stopVideo();youTubePlayer.destroy();youTubePlayer=null;}
$modal.data('youtube-video-id',_options.videoId);$modal.find('.modal-video').html($('#tpl-youtube-video-default-markup').html());if(_options.videos&&_options.videos.length>0){playlistTemplate=_.template($('#tpl-youtube-playlist-item').html());playlistContents='';for(i=0;i<_options.videos.length;++i){playlistContents+=playlistTemplate(_options.videos[i]);}
_youTubeVideos=_options.videos;$modal.find('.modal-video-playlist ul').html(playlistContents).data('page',0);$modal.find('.modal-video-playlist .playlist-count').text(_options.videos.length);$modal.removeClass().addClass('modal fade video-content playlist');$modal.modal();}else{$modal.removeClass().addClass('modal fade video-content in');$modal.modal();}});}}
function isReady(){return _youTubeInitFinished;}
return{setDotCount:setDotCount,setAutosizeDotBar:setAutosizeDotBar,setupGroup:setupGroup,showGroup:showGroup,setTrayThumbCount:setTrayThumbCount,setupYouTube:setupYouTube,showYouTube:showYouTube,setupPoster:setupPoster,showPoster:showPoster,findYouTubeId:findYouTubeId,isReady:isReady};}());

/* end /web-platform/scripts/web-platform/component/media-modal.js*/

/* start /web-platform/scripts/web-platform/component/media-query-detection.js*/
SOE.MediaQueryDetection=(function(){var currentSize;var currentBreakPoint;var breakPoints=[{size:480,value:"xs"},{size:768,value:"xs"},{size:992,value:"sm"},{size:1200,value:"md"},{size:1e9,value:"lg"}];var detectBreakpointChange=function(){var newBreakPoint=detectBreakpoint();if(currentBreakPoint!==newBreakPoint.size){currentBreakPoint=newBreakPoint.size;$(window).trigger("soe.breakpointChanged",{breakpoint:newBreakPoint.value});}};var detectBreakpoint=function(){var k;currentSize=window.innerWidth||document.documentElement.clientWidth;for(k=0;k<breakPoints.length;k++){if(currentSize<breakPoints[k].size){break;}}
return breakPoints[k];};var init=function(){currentBreakPoint=detectBreakpoint().size;$(window).on("resize",detectBreakpointChange);$(window).trigger("soe.breakpointSet",{breakpoint:detectBreakpoint().value});};return{init:init,detectBreakpoint:detectBreakpoint};})();SOE.MediaQueryDetection.init();

/* end /web-platform/scripts/web-platform/component/media-query-detection.js*/

/* start /web-platform/scripts/web-platform/component/hero-carousel/hero-carousel.js*/
window.SOE=window.SOE||{};SOE.HeroCarousel={currentVersion:'',renderMobileVersion:function(){'use strict';$('.carousel-outer-wrapper').html(_.template($('#tpl-carousel-mobile').html()));},renderDesktopVersion:function(){'use strict';var intervalTime=parseInt($('.carousel-outer-wrapper').attr('data-interval-time'),10)||5000;var transitionTime=parseInt($('.carousel-outer-wrapper').attr('data-transition-time'),10)||400;var transitionStyle=$('.carousel-outer-wrapper').attr('data-transition-style')||'duck';$('.carousel-outer-wrapper').html(_.template($('#tpl-carousel-desktop').html()));$('.carousel').on('slide.bs.carousel',function(e){var fadeOutDelay=transitionStyle==='dissolve'?transitionTime:0;var fadeOutTime=transitionStyle==='dissolve'?0:transitionTime;var fadeInDelay=transitionStyle==='dissolve'?0:transitionTime;var fadeInTime=transitionTime;$('.background-takeovers .background-takeover').delay(fadeOutDelay).fadeOut(fadeOutTime,function(){$(this).remove();});$('.background-takeover',e.relatedTarget).clone().appendTo('.background-takeovers').delay(fadeInDelay).fadeIn(fadeInTime).find('.background[data-scale-start][data-scale-end]').animate({bgScale:1},{duration:intervalTime,progress:SOE.HeroCarousel.zoomProgress,queue:false,easing:'linear'});SOE.HeroCarousel.updateCaptions($(e.relatedTarget));});$('.carousel').each(function(){var $this=$(this);var id=$this.attr('id');try{$('#'+id).swipe({excludedElements:'button, input, select, textarea, .noSwipe',swipeLeft:function(){$this.carousel('next');},swipeRight:function(){$this.carousel('prev');},tap:function(event,target){if(typeof window.ontouchstart!=='undefined'){$(target).trigger('click');}}});}catch(e){}});if($('.item.active .background-takeover').length>0){$('.item.active .background-takeover').clone().css('display','block').appendTo('.background-takeovers').find('.background[data-scale-start][data-scale-end]').animate({bgScale:1},{duration:intervalTime,progress:SOE.HeroCarousel.zoomProgress,queue:false,easing:'linear'});}
SOE.HeroCarousel.createBackgroundVideos();SOE.HeroCarousel.createCtaLinks();$('.carousel').carousel({interval:intervalTime});SOE.HeroCarousel.updateCaptions($('.carousel-inner .item.active'));$(document).on('mouseenter','.background-takeovers .markup',function(){$('.carousel').carousel('pause');});$(document).on('mouseleave','.background-takeovers .markup',function(){$('.carousel').carousel('cycle');});},zoomProgress:function(animation,progress){'use strict';function lerp(a,b,x){return(a*(1-x))+(b*x);}
if(this.hasAttribute('data-scale-start')&&this.hasAttribute('data-scale-end')){var startScale=parseFloat(this.getAttribute('data-scale-start'));var endScale=parseFloat(this.getAttribute('data-scale-end'));var currentScale=lerp(startScale,endScale,easing.easeInOutQuad(progress));this.style.transform='scale('+currentScale+')';}},updateCaptions:function($activeSlide){'use strict';var useCaptions=$('.carousel-outer-wrapper').hasClass('carousel-captioned');var captionEllipsisLength=parseInt($('.carousel-outer-wrapper').attr('data-caption-ellipsis-length'),10)||30;var $allSlides;var idxCurrent,idxPrev,idxNext;if(useCaptions){$allSlides=$('.carousel-inner .item');idxCurrent=$allSlides.index($activeSlide);idxNext=(idxCurrent+1)%$allSlides.length;idxPrev=idxCurrent-1;if(idxPrev<0){idxPrev+=$allSlides.length;}
$('.carousel-control.left .carousel-control-caption').html(SOE.Utils.ellipsisAtBreak($allSlides.eq(idxPrev).attr('data-title')||'',captionEllipsisLength));$('.carousel-control.right .carousel-control-caption').html(SOE.Utils.ellipsisAtBreak($allSlides.eq(idxNext).attr('data-title')||'',captionEllipsisLength));}},createCtaLinks:function(){'use strict';function isNonEmptyTextNode(i,el){return el.nodeType===3&&el.textContent.trim().length>0;}
$('.wgt-hero-2 > .markup').each(function(){var $markup=$(this);$markup.children('p').each(function(){var $paragraph=$(this);if($paragraph.contents().filter(isNonEmptyTextNode).length<=0){$paragraph.addClass('cta-wrapper');$paragraph.children('a').addClass('cta');}});if($markup.find('.cta.primary').length<=0){$markup.find('.cta').first().addClass('primary');}});},createBackgroundVideos:function(){'use strict';var videoTemplate=_.template($('#tpl-carousel-video').html(),null,{variable:'data'});var breakpoint=SOE.MediaQueryDetection.detectBreakpoint().value;function hasVideoAttributes(i,el){return el.hasAttribute('data-video-mp4')||el.hasAttribute('data-video-webm');}
$('.background-takeover .background').filter(hasVideoAttributes).each(function(i,el){if(breakpoint!=='xs'||el.classList.contains('needs-video')){$(this).addClass('has-video').append(videoTemplate({mp4:el.getAttribute('data-video-mp4'),webm:el.getAttribute('data-video-webm')}));}});}};if(document.getElementById('tpl-carousel-mobile')!==null){if(SOE.MediaQueryDetection.detectBreakpoint().value==='xs'){SOE.HeroCarousel.renderMobileVersion();SOE.HeroCarousel.currentVersion='mobile';}else{SOE.HeroCarousel.renderDesktopVersion();SOE.HeroCarousel.currentVersion='desktop';}
$(window).on('soe.breakpointChanged',function(e,breakpoint){'use strict';if(breakpoint.breakpoint==='xs'&&SOE.HeroCarousel.currentVersion!=='mobile'){SOE.HeroCarousel.renderMobileVersion();SOE.HeroCarousel.currentVersion='mobile';}else if((breakpoint.breakpoint==='sm'||breakpoint.breakpoint==='md'||breakpoint.breakpoint==='lg')&&SOE.HeroCarousel.currentVersion!=='desktop'){SOE.HeroCarousel.renderDesktopVersion();SOE.HeroCarousel.currentVersion='desktop';}});}else{SOE.HeroCarousel.renderDesktopVersion();SOE.HeroCarousel.currentVersion=(SOE.MediaQueryDetection.detectBreakpoint().value==='xs')?'mobile':'desktop';$(window).on('soe.breakpointChanged',function(e,breakpoint){'use strict';if((breakpoint.breakpoint==='xs'&&SOE.HeroCarousel.currentVersion!=='mobile')||(breakpoint.breakpoint!=='xs'&&SOE.HeroCarousel.currentVersion==='mobile')){SOE.HeroCarousel.renderDesktopVersion();SOE.HeroCarousel.currentVersion=(breakpoint.breakpoint==='xs')?'mobile':'desktop';}});}
$(document).on('click','.carousel-outer-wrapper a',function(e){'use strict';var videoId=SOE.MediaModal.findYouTubeId(this.getAttribute('href'));if(SOE.MediaModal.isReady()&&videoId&&$(window).width()>=768&&!globs.wdl.wdlCookDNT){e.preventDefault();SOE.MediaModal.showYouTube({videoId:videoId});}});

/* end /web-platform/scripts/web-platform/component/hero-carousel/hero-carousel.js*/
